<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/jsp/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Dotnet2-web 后台管理系统</title>
<!--[if lt IE 9]>
<script src="js/html5.js"></script>
<![endif]-->
<%@ include file="/jsp/common/commonJs.jsp"%>
</head>
<body>
<!--header-->
<%@ include file="/jsp/top.jsp"%>
<!--header-->

<!--aside nav-->
<%@ include file="/jsp/left.jsp"%>
<!--aside nav  -->
<section class="rt_wrap content mCustomScrollbar" style="margin-top:10px;">
      <div class="page_title">
      		
      		<a class="fr top_rt_btn" href="javascript:js.back()">返回上一页</a>
      		<a class="fr top_rt_btn" href="${path}/field/toAdd.do?productId=${productId}">添加属性</a>
      </div>
      <table class="table">
       <tr> 
	        <th>属性名称</th>
	        <th>属性name</th>
	        <th>属性类型</th>
	        <!-- <th>创建时间</th> -->
	        <th>是否为特殊计价</th>
	        <th>是否启用</th>
	        <th>是否删除</th>
	        <th>是否参与计价</th>
	        <th>查看</th>
	        <th>操作</th>
       </tr>
       	<c:forEach items="${fieldList}" var="field">
      		<tr align="center">
		        <td>${field.fieldName}</td>
		        <td>${field.inputName}</td>
		        <td>${field.fieldType}</td>
		       <%--  <td><fmt:formatDate value="${field.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td> --%>
		        <td>${field.isSpe==1?"<font color=green>是</font>":"<font color=red>否</font>"}</td>
		        <td>${field.isUse==1?"<font color=green>是</font>":"<font color=red>否</font>"}</td>
		        <td>${field.isDelete==1?"<font color=green>是</font>":"<font color=red>否</font>"}</td>
		        <td>${field.isSum==1?"<font color=green>是</font>":"<font color=red>否</font>"}</td>
		        <td>
		        	<c:if test="${field.isSum==1 && (field.fieldType=='radio' || field.fieldType=='select' || field.fieldType=='checkbox') && (field.isUse==1 && field.isDelete==0) }">
		        		<a href="${path}/field/fieldPriceListByFieldId.do?fieldId=${field.id}&productId=${field.productId}" >查看属性价格</a>
		        		<a href="${path}/field/toAddFieldValue.do?fieldId=${field.id}&productId=${field.productId}" >添加属性显示值</a>
		        		<a href="${path}/field/toAddFieldPrice.do?fieldId=${field.id}&productId=${field.productId}" >添加属性价格</a>
		        	</c:if>
		        	<c:if test="${field.isSum==1 && (field.fieldType=='text')}">
		        		<a href="${path}/field/toAddFieldValue.do?fieldId=${field.id}&productId=${field.productId}" >添加所需价格</a>
		        	</c:if>
		        	<c:if test="${field.isSum==1 && (field.fieldType=='hidden')}">
		        		<a href="${path}/field/toAddFieldValue.do?fieldId=${field.id}&productId=${field.productId}" >添加隐藏价格</a>
		        	</c:if>
		        	<c:if test="${field.isSum==0 && (field.fieldType=='radio' || field.fieldType=='select' || field.fieldType=='hidden' || field.fieldType=='checkbox') && (field.isUse==1 && field.isDelete==0)}">
		        		<a href="${path}/field/fieldPriceListByFieldId.do?fieldId=${field.id}&productId=${field.productId}" >查看属性内部值</a>
		        		<a href="${path}/field/toAddFieldValue.do?fieldId=${field.id}&productId=${field.productId}" >添加属性显示值</a>
		        		<a href="${path}/field/toAddFieldPrice.do?fieldId=${field.id}&productId=${field.productId}" >添加属性内部值</a>
		        	</c:if>
		        </td>
		        <td>
		        	<c:if test="${field.isUse==1 && field.isDelete==0}">
		        	<a href="${path}/field/toFieldUpdate.do?id=${field.id}">修改</a>
		        	</c:if>
		        	<!-- 是否删除判断 -->
       				 <a class="btn btn-warning" href="${path}/field/fieldDel.do?id=${field.id}&isDelete=${field.isDelete}&productId=${field.productId}">
       					<c:if test="${field.isDelete==0}">删除</c:if>
       					<c:if test="${field.isDelete==1}">恢复</c:if>
       				</a> 
       				 <a class="btn btn-warning" href="${path}/field/fieldUp.do?id=${field.id}&isUse=${field.isUse}&productId=${field.productId}">
       					<c:if test="${field.isUse==0}">启用</c:if>
       					<c:if test="${field.isUse==1}">停用</c:if>
       				</a> 
		        	<c:if test="${field.isUse==1 && field.isDelete==0}">
		        		<a href="${path}/field/fieldValueListByFieldId.do?fieldId=${field.id}&productId=${field.productId}" >查看属性值</a>
		        		
		        	</c:if>
		        </td>
		    </tr>
      	</c:forEach>
      </table>
	 <aside class="paging">
		  <c:forEach items="${page.pageView}" var="page">
		  		${page}
		  </c:forEach>
	 </aside>
</section>

</body>
</html>
